package org.example.blog.controller;

import lombok.AllArgsConstructor;
import org.example.blog.dto.UserDTO;
import org.example.blog.service.UserService;
import org.example.blog.vo.UserVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("/user")

public class UserController {

    private final UserService userService;


    @PostMapping("/login")
    public UserVO login(@RequestBody UserDTO userDTO) {
        UserVO login = userService.login(userDTO);
        return login;
    }
}
